
// 所有的请求都放在该目录
import instance from "../utils/request";
//首页数据请求
export function GetIndexData(){
    return instance.get('/index/index')
}
//搜索页数据
export function GetSearchData(params){
    return instance.get('/goods/list',
   { params:params})
}
//历史记录和热门搜索
export function GetPopupData(params) {
    return instance({
        url: '/search/index',
        method: 'get',
        params: params
    })
}
//删除历史记录
export function Clearhistory(params) {
    return instance({
        url: '/search/clearhistory',
        method: 'post',
        data: params
    })
}

//搜索提示列表
export function GetSearchTipsListData(params) {
    return instance({
        url: '/search/helper',
        method: 'get',
        params
    })
}

// 全部分类数据接口
export function GetChannelDataApi(params) {
    return instance({
        url: '/api/catalog/index',
        method: 'get',
        params
    })
}
// 获取当前分类数据
export function GetListData(params) {
    return instance({
        url: '/goods/category',
        method: 'get',
        params
    })
}

//分类页数据
export function GetListData1(params) {
    return instance({
        url: '/goods/list',
        method: 'get',
        params
    })
}


//获取详情页数据
export function GetDetailData(params) {
    return instance({
        url: '/goods/detail',
        method: 'get',
        params,
    })
}
//相关商品
export function GetGoodsRelatedData(params) {
    return instance({
        url: '/goods/related',
        method: 'get',
        params
    })
}
//获取商品数量
export function GetCartNum(params) {
    return instance({
        url: '/cart/goodscount',
        method: 'get',
        params
    })
}
// 添加到购物车
export function AddToCart(params) {
    return instance.post('/cart/add',params)
}



//专题页
export function getTopicList(params) {
    return instance({
        url: '/topic/list',
        method: 'get',
        params
    })
}

